set(CXX_FLAGS
    -g
    -DCHECK_PTHREAD_RETURN_VALUE
    -D_FILE_OFFSET_BITS=64
    -Wall
    -Wextra
    -Werror
    -Wno-conversion
    -Wno-stringop-truncation
    -Wno-format-truncation
    -Wno-unused-parameter
    -Wold-style-cast
    -Woverloaded-virtual
    -Wpointer-arith
    -Wwrite-strings
    -std=c++11
    -rdynamic
)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")

set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")

SET(CMAKE_BUILD_TYPE "$ENV{BUILD_TYPE}")
SET(CMAKE_USE_RELATIVE_PATHS "ON")
SET(CMAKE_CXX_COMPILER "g++")
SET(CMKAE_C_COMPILER "gcc")
SET(CMAKE_BUILD_TYPE Debug)